/*
 * Copyright (c) 2024 iSOFT INFRASTRUCTURE SOFTWARE CO., LTD.
 * easyAda is licensed under Mulan PubL v2.
 * You can use this software according to the terms and conditions of the Mulan PubL v2.
 * You may obtain a copy of Mulan PubL v2 at:
 *          http://license.coscl.org.cn/MulanPubL-2.0
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PubL v2 for more details.
 */

#ifndef DPRINTF_H
#define DPRINTF_H

#include <plat/config.h>
#include <stdlib/stdarg.h>
#include <stdlib/stdint.h>
#include <stdlib/stddef.h>

extern unsigned char dprintf_regs_index;

static char *fmt_d(char *buf, char *bufend, int64_t value, char long_flag);
static char *fmt_x(char *buf, char *bufend, uint64_t value, int X);
static char *fmt_s(char *buf, char *bufend, const char *s);

int vsnprintf(char *buf, size_t size, const char *fmt, va_list ap);
int debug_printf(const char *fmt, ...);
#define dprintf(...) (void)debug_printf(__VA_ARGS__)

void print_line(void);
void set_available_lock_flag(int val);

#endif
